﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Library;
namespace QuanLyThi
{
    public partial class FrmMain : Form
    {

        public static string mConnect = FrmDangNhap.mConnect;
        private string msql = "";
        public DGC_Library mLibrary=new DGC_Library(mConnect);

        public static string Manguoidung = "";
        public static string Tennguoidung = "";
   
        public FrmMain(string Manguoidung,string Tennguoidung)
        {
            InitializeComponent();
            FrmMain.Manguoidung = Manguoidung;
            FrmMain.Tennguoidung = Manguoidung;
          
            
            toolStripStatusLabel1.Text = "Tên máy: " + mLibrary.Timten("select Host_name()");
            toolStripStatusLabel2.Text = "Tên truy cập: " + Tennguoidung;
            toolStripStatusLabel3.Text = "Bắt đầu: " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
        }
      
        private void FrmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void chươngTrìnhĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {           
            FrmChuongTrinhDaoTao f = new FrmChuongTrinhDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void khoaĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmKhoaDaoTao f = new FrmKhoaDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void mônĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmMonDaoTao f = new FrmMonDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhChươngTrìnhĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhChuongTrinhDaoTao f = new FrmCauHinhChuongTrinhDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhKhoaĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhKhoaDaoTao f = new FrmCauHinhKhoaDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhLớpĐàoTạoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmLopDaoTao f = new FrmLopDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhLớpĐàoTạoToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FrmCauHinhLopDaoTao f = new FrmCauHinhLopDaoTao();
            f.MdiParent = this;
            f.Show();
        }

        private void dangKyHocVienToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDangKyHocVien f = new FrmDangKyHocVien();
            f.MdiParent = this;
            f.Show();
        }

        private void đăngNhậpLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void thayĐổiMậtKhẩuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmThayDoiMatKhau f = new FrmThayDoiMatKhau();           
            f.ShowDialog();
        }

        private void đăngKýLớpHọcChoHọcViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDangKyLopHocTheoLop f = new FrmDangKyLopHocTheoLop();
            f.MdiParent = this;
            f.Show();
        }

        private void danhSáchHọcViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDanhSachHocVien f = new FrmDanhSachHocVien();
            f.MdiParent = this;
            f.Show();
        }

        private void đăngKýThiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDangKyThi f = new FrmDangKyThi();
            f.MdiParent = this;
            f.Show();
        }

        private void huToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmHuyDangKyThi f = new FrmHuyDangKyThi();
            f.MdiParent = this;
            f.Show();
        }

        private void đăngKýThiLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDangKyThiLai f = new FrmDangKyThiLai();
            f.MdiParent = this;
            f.Show();
        }

        private void hủyĐăngKýThiLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmHuyDangKyThiLai f = new FrmHuyDangKyThiLai();
            f.MdiParent = this;
            f.Show();
        }

        private void lịchThiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmLichThi f = new FrmLichThi();
            f.MdiParent = this;
            f.Show();
        }

        private void kếtQuảThiTheoLớpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmKetQuaThiTheoLop f = new FrmKetQuaThiTheoLop();
            f.MdiParent = this;
            f.Show();
        }

        private void bảngĐiểmHọcViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmBangDiemHocVien f = new FrmBangDiemHocVien();
            f.MdiParent = this;
            f.Show();
        }

        private void xemLạiBàiThiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmXemLaiBaiThi f = new FrmXemLaiBaiThi();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhMônThiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhMonThi f = new FrmCauHinhMonThi();
            f.MdiParent = this;
            f.Show();
        }

        private void danhMụcBiênSoạnĐềThiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDanhMucBienSoanDeThi f = new FrmDanhMucBienSoanDeThi();
            f.MdiParent = this;
            f.Show();
        }

        private void danhSáchNgânHàngCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDanhSachNganHangCauHoi f = new FrmDanhSachNganHangCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void thiếtLậpMứcĐộCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmThietLapMucDoCauHoi f = new FrmThietLapMucDoCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void thiếtLậpChủĐềCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmThietLapChuDeCauHoi f = new FrmThietLapChuDeCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhMứcĐộCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhMucDoCauHoi f = new FrmCauHinhMucDoCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhChủĐềCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhChuDeCauHoi f = new FrmCauHinhChuDeCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void cấuHìnhChủĐềBắtBuộcToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCauHinhChuDeBatBuoc f = new FrmCauHinhChuDeBatBuoc();
            f.MdiParent = this;
            f.Show();
        }

        private void ngânHàngCâuHỏiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmNganHangCauHoi f = new FrmNganHangCauHoi();
            f.MdiParent = this;
            f.Show();
        }

        private void mToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainForm f = new MainForm();
            f.MdiParent = this;
            f.Show();
        }

        private void tạoĐềThiTrênLớpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmTaoDeThi f = new FrmTaoDeThi();
            f.MdiParent = this;
            f.Show();
        }

        private void tạoMâToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmTaoMauDeThi f = new FrmTaoMauDeThi();
            f.MdiParent = this;
            f.Show();
        }

       
    }
}
